<!--
 * @Autor: 张小鹏
 * @Date: 2020-04-17 15:50:59
 * @LastEditors: 张小鹏
 * @LastEditTime: 2020-04-26 17:14:38
 * @description:
 -->
<template>
  <div class="main">
    <h2>修改cascader源代码，去除本地搜索逻辑，支持远程搜索。</h2>
    <el-form :inline="true" class="demo-form-inline">
      <el-form-item label="省份">
        <org-select ref="province" :region-select="['省份']" size="medium" placeholder="选择省份" @change="handleProvSelect"/>
      </el-form-item>
      <el-form-item label="城市">
        <org-select ref="city" :region-select="['省份','城市']" size="medium" placeholder="选择城市" @change="handleCitySelect"/>
      </el-form-item>
      <el-form-item label="县或区">
        <org-select ref="county" :region-select="['省份','城市','县']" size="medium" placeholder="选择县或区" @change="handleAreaSelect"/>
      </el-form-item>
    </el-form>
    <h2/>

  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {}
  },
  computed: {
    province() {
      return this.$refs.province
    },
    city() {
      return this.$refs.city
    },
    county() {
      return this.$refs.county
    }
  },
  mounted() {
    this.province.setvalue({
      value: ['13'],
      name: '河北省',
      parentOrgCode: ['']
    })
    this.city.setvalue({
      value: ['1301'],
      name: '石家庄市',
      parentOrgCode: ['13']
    })
    this.county.setvalue({
      value: ['130102'],
      name: '石家庄市',
      parentOrgCode: ['13', '1301']
    })

    // 130102
    // 1301
  },
  methods: {
    handleProvSelect(orgselect) {

    },
    handleCitySelect(orgselect) {

    },
    handleAreaSelect(orgselect) {

    }
  }
}
</script>
<style>
.main{
    margin-top:20px;
}
</style>
